3.76 \(\int (e x)^{-1+2 n} (a+b \sec (c+d x^n))^2 \, dx\)

Optimal. Leaf size=221 \[ \frac{2 i a b x^{-2 n} (e x)^{2 n} \text{PolyLog}\left (2,-i e^{i \left (c+d x^n\right )}\right )}{d^2 e n}-\frac{2 i a b x^{-2 n} (e x)^{2 n} \text{PolyLog}\left (2,i e^{i \left (c+d x^n\right )}\right )}{d^2 e n}+\frac{a^2 (e x)^{2 n}}{2 e n}-\frac{4 i a b x^{-n} (e x)^{2 n} \tan ^{-1}\left (e^{i \left (c+d x^n\right )}\right )}{d e n}+\frac{b^2 x^{-2 n} (e x)^{2 n} \log \left (\cos \left (c+d x^n\right )\right )}{d^2 e n}+\frac{b^2 x^{-n} (e x)^{2 n} \tan \left (c+d x^n\right )}{d e n} \]

[Out]

(a^2*(e*x)^(2*n))/(2*e*n) - ((4*I)*a*b*(e*x)^(2*n)*ArcTan[E^(I*(c + d*x^n))])/(d*e*n*x^n) + (b^2*(e*x)^(2*n)*L
og[Cos[c + d*x^n]])/(d^2*e*n*x^(2*n)) + ((2*I)*a*b*(e*x)^(2*n)*PolyLog[2, (-I)*E^(I*(c + d*x^n))])/(d^2*e*n*x^
(2*n)) - ((2*I)*a*b*(e*x)^(2*n)*PolyLog[2, I*E^(I*(c + d*x^n))])/(d^2*e*n*x^(2*n)) + (b^2*(e*x)^(2*n)*Tan[c +
d*x^n])/(d*e*n*x^n)

________________________________________________________________________________________

Rubi [A]  time = 0.199529, antiderivative size = 221, normalized size of antiderivative = 1., number of steps used = 11, number of rules used = 8, integrand size = 24, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.333, Rules used = {4208, 4204, 4190, 4181, 2279, 2391, 4184, 3475} \[ \frac{2 i a b x^{-2 n} (e x)^{2 n} \text{PolyLog}\left (2,-i e^{i \left (c+d x^n\right )}\right )}{d^2 e n}-\frac{2 i a b x^{-2 n} (e x)^{2 n} \text{PolyLog}\left (2,i e^{i \left (c+d x^n\right )}\right )}{d^2 e n}+\frac{a^2 (e x)^{2 n}}{2 e n}-\frac{4 i a b x^{-n} (e x)^{2 n} \tan ^{-1}\left (e^{i \left (c+d x^n\right )}\right )}{d e n}+\frac{b^2 x^{-2 n} (e x)^{2 n} \log \left (\cos \left (c+d x^n\right )\right )}{d^2 e n}+\frac{b^2 x^{-n} (e x)^{2 n} \tan \left (c+d x^n\right )}{d e n} \]

Antiderivative was successfully verified.

[In]

Int[(e*x)^(-1 + 2*n)*(a + b*Sec[c + d*x^n])^2,x]

[Out]

(a^2*(e*x)^(2*n))/(2*e*n) - ((4*I)*a*b*(e*x)^(2*n)*ArcTan[E^(I*(c + d*x^n))])/(d*e*n*x^n) + (b^2*(e*x)^(2*n)*L
og[Cos[c + d*x^n]])/(d^2*e*n*x^(2*n)) + ((2*I)*a*b*(e*x)^(2*n)*PolyLog[2, (-I)*E^(I*(c + d*x^n))])/(d^2*e*n*x^
(2*n)) - ((2*I)*a*b*(e*x)^(2*n)*PolyLog[2, I*E^(I*(c + d*x^n))])/(d^2*e*n*x^(2*n)) + (b^2*(e*x)^(2*n)*Tan[c +
d*x^n])/(d*e*n*x^n)

Rule 4208

Int[((e_)*(x_))^(m_.)*((a_.) + (b_.)*Sec[(c_.) + (d_.)*(x_)^(n_)])^(p_.), x_Symbol] :> Dist[(e^IntPart[m]*(e*x
)^FracPart[m])/x^FracPart[m], Int[x^m*(a + b*Sec[c + d*x^n])^p, x], x] /; FreeQ[{a, b, c, d, e, m, n, p}, x]

Rule 4204

Int[(x_)^(m_.)*((a_.) + (b_.)*Sec[(c_.) + (d_.)*(x_)^(n_)])^(p_.), x_Symbol] :> Dist[1/n, Subst[Int[x^(Simplif
y[(m + 1)/n] - 1)*(a + b*Sec[c + d*x])^p, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p}, x] && IGtQ[Simplify[
(m + 1)/n], 0] && IntegerQ[p]

Rule 4190

Int[(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(n_.)*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[
(c + d*x)^m, (a + b*Csc[e + f*x])^n, x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && IGtQ[m, 0] && IGtQ[n, 0]

Rule 4181

Int[csc[(e_.) + Pi*(k_.) + (f_.)*(x_)]*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp[(-2*(c + d*x)^m*ArcTanh[E
^(I*k*Pi)*E^(I*(e + f*x))])/f, x] + (-Dist[(d*m)/f, Int[(c + d*x)^(m - 1)*Log[1 - E^(I*k*Pi)*E^(I*(e + f*x))],
 x], x] + Dist[(d*m)/f, Int[(c + d*x)^(m - 1)*Log[1 + E^(I*k*Pi)*E^(I*(e + f*x))], x], x]) /; FreeQ[{c, d, e,
f}, x] && IntegerQ[2*k] && IGtQ[m, 0]

Rule 2279

Int[Log[(a_) + (b_.)*((F_)^((e_.)*((c_.) + (d_.)*(x_))))^(n_.)], x_Symbol] :> Dist[1/(d*e*n*Log[F]), Subst[Int
[Log[a + b*x]/x, x], x, (F^(e*(c + d*x)))^n], x] /; FreeQ[{F, a, b, c, d, e, n}, x] && GtQ[a, 0]

Rule 2391

Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> -Simp[PolyLog[2, -(c*e*x^n)]/n, x] /; FreeQ[{c, d,
 e, n}, x] && EqQ[c*d, 1]

Rule 4184

Int[csc[(e_.) + (f_.)*(x_)]^2*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> -Simp[((c + d*x)^m*Cot[e + f*x])/f, x]
+ Dist[(d*m)/f, Int[(c + d*x)^(m - 1)*Cot[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && GtQ[m, 0]

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int (e x)^{-1+2 n} \left (a+b \sec \left (c+d x^n\right )\right )^2 \, dx &=\frac{\left (x^{-2 n} (e x)^{2 n}\right ) \int x^{-1+2 n} \left (a+b \sec \left (c+d x^n\right )\right )^2 \, dx}{e}\\ &=\frac{\left (x^{-2 n} (e x)^{2 n}\right ) \operatorname{Subst}\left (\int x (a+b \sec (c+d x))^2 \, dx,x,x^n\right )}{e n}\\ &=\frac{\left (x^{-2 n} (e x)^{2 n}\right ) \operatorname{Subst}\left (\int \left (a^2 x+2 a b x \sec (c+d x)+b^2 x \sec ^2(c+d x)\right ) \, dx,x,x^n\right )}{e n}\\ &=\frac{a^2 (e x)^{2 n}}{2 e n}+\frac{\left (2 a b x^{-2 n} (e x)^{2 n}\right ) \operatorname{Subst}\left (\int x \sec (c+d x) \, dx,x,x^n\right )}{e n}+\frac{\left (b^2 x^{-2 n} (e x)^{2 n}\right ) \operatorname{Subst}\left (\int x \sec ^2(c+d x) \, dx,x,x^n\right )}{e n}\\ &=\frac{a^2 (e x)^{2 n}}{2 e n}-\frac{4 i a b x^{-n} (e x)^{2 n} \tan ^{-1}\left (e^{i \left (c+d x^n\right )}\right )}{d e n}+\frac{b^2 x^{-n} (e x)^{2 n} \tan \left (c+d x^n\right )}{d e n}-\frac{\left (2 a b x^{-2 n} (e x)^{2 n}\right ) \operatorname{Subst}\left (\int \log \left (1-i e^{i (c+d x)}\right ) \, dx,x,x^n\right )}{d e n}+\frac{\left (2 a b x^{-2 n} (e x)^{2 n}\right ) \operatorname{Subst}\left (\int \log \left (1+i e^{i (c+d x)}\right ) \, dx,x,x^n\right )}{d e n}-\frac{\left (b^2 x^{-2 n} (e x)^{2 n}\right ) \operatorname{Subst}\left (\int \tan (c+d x) \, dx,x,x^n\right )}{d e n}\\ &=\frac{a^2 (e x)^{2 n}}{2 e n}-\frac{4 i a b x^{-n} (e x)^{2 n} \tan ^{-1}\left (e^{i \left (c+d x^n\right )}\right )}{d e n}+\frac{b^2 x^{-2 n} (e x)^{2 n} \log \left (\cos \left (c+d x^n\right )\right )}{d^2 e n}+\frac{b^2 x^{-n} (e x)^{2 n} \tan \left (c+d x^n\right )}{d e n}+\frac{\left (2 i a b x^{-2 n} (e x)^{2 n}\right ) \operatorname{Subst}\left (\int \frac{\log (1-i x)}{x} \, dx,x,e^{i \left (c+d x^n\right )}\right )}{d^2 e n}-\frac{\left (2 i a b x^{-2 n} (e x)^{2 n}\right ) \operatorname{Subst}\left (\int \frac{\log (1+i x)}{x} \, dx,x,e^{i \left (c+d x^n\right )}\right )}{d^2 e n}\\ &=\frac{a^2 (e x)^{2 n}}{2 e n}-\frac{4 i a b x^{-n} (e x)^{2 n} \tan ^{-1}\left (e^{i \left (c+d x^n\right )}\right )}{d e n}+\frac{b^2 x^{-2 n} (e x)^{2 n} \log \left (\cos \left (c+d x^n\right )\right )}{d^2 e n}+\frac{2 i a b x^{-2 n} (e x)^{2 n} \text{Li}_2\left (-i e^{i \left (c+d x^n\right )}\right )}{d^2 e n}-\frac{2 i a b x^{-2 n} (e x)^{2 n} \text{Li}_2\left (i e^{i \left (c+d x^n\right )}\right )}{d^2 e n}+\frac{b^2 x^{-n} (e x)^{2 n} \tan \left (c+d x^n\right )}{d e n}\\ \end{align*}

Mathematica [A]  time = 4.62727, size = 347, normalized size = 1.57 \[ \frac{x^{-2 n} (e x)^{2 n} \left (-\frac{4 a b \csc (c) \left (i \text{PolyLog}\left (2,-e^{i \left (d x^n-\tan ^{-1}(\cot (c))\right )}\right )-i \text{PolyLog}\left (2,e^{i \left (d x^n-\tan ^{-1}(\cot (c))\right )}\right )+\left (d x^n-\tan ^{-1}(\cot (c))\right ) \left (\log \left (1-e^{i \left (d x^n-\tan ^{-1}(\cot (c))\right )}\right )-\log \left (1+e^{i \left (d x^n-\tan ^{-1}(\cot (c))\right )}\right )\right )\right )}{\sqrt{\csc ^2(c)}}+d x^n \left (a^2 d x^n+2 b^2 \tan (c)\right )+8 a b \tan ^{-1}(\cot (c)) \tanh ^{-1}\left (\cos (c) \tan \left (\frac{d x^n}{2}\right )+\sin (c)\right )-2 b^2 d \tan (c) x^n+\frac{2 b^2 d x^n \sin \left (\frac{d x^n}{2}\right )}{\left (\cos \left (\frac{c}{2}\right )-\sin \left (\frac{c}{2}\right )\right ) \left (\cos \left (\frac{1}{2} \left (c+d x^n\right )\right )-\sin \left (\frac{1}{2} \left (c+d x^n\right )\right )\right )}+\frac{2 b^2 d x^n \sin \left (\frac{d x^n}{2}\right )}{\left (\sin \left (\frac{c}{2}\right )+\cos \left (\frac{c}{2}\right )\right ) \left (\sin \left (\frac{1}{2} \left (c+d x^n\right )\right )+\cos \left (\frac{1}{2} \left (c+d x^n\right )\right )\right )}+2 b^2 \left (d \tan (c) x^n+\log \left (\cos \left (c+d x^n\right )\right )\right )\right )}{2 d^2 e n} \]

Warning: Unable to verify antiderivative.

[In]

Integrate[(e*x)^(-1 + 2*n)*(a + b*Sec[c + d*x^n])^2,x]

[Out]

((e*x)^(2*n)*(8*a*b*ArcTan[Cot[c]]*ArcTanh[Sin[c] + Cos[c]*Tan[(d*x^n)/2]] - (4*a*b*Csc[c]*((d*x^n - ArcTan[Co
t[c]])*(Log[1 - E^(I*(d*x^n - ArcTan[Cot[c]]))] - Log[1 + E^(I*(d*x^n - ArcTan[Cot[c]]))]) + I*PolyLog[2, -E^(
I*(d*x^n - ArcTan[Cot[c]]))] - I*PolyLog[2, E^(I*(d*x^n - ArcTan[Cot[c]]))]))/Sqrt[Csc[c]^2] + (2*b^2*d*x^n*Si
n[(d*x^n)/2])/((Cos[c/2] - Sin[c/2])*(Cos[(c + d*x^n)/2] - Sin[(c + d*x^n)/2])) + (2*b^2*d*x^n*Sin[(d*x^n)/2])
/((Cos[c/2] + Sin[c/2])*(Cos[(c + d*x^n)/2] + Sin[(c + d*x^n)/2])) - 2*b^2*d*x^n*Tan[c] + d*x^n*(a^2*d*x^n + 2
*b^2*Tan[c]) + 2*b^2*(Log[Cos[c + d*x^n]] + d*x^n*Tan[c])))/(2*d^2*e*n*x^(2*n))

________________________________________________________________________________________

Maple [C]  time = 0.267, size = 1096, normalized size = 5. \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((e*x)^(-1+2*n)*(a+b*sec(c+d*x^n))^2,x)

[Out]

1/2*a^2/n*x*exp(-1/2*(-1+2*n)*(I*csgn(I*e)*csgn(I*x)*csgn(I*e*x)*Pi-I*csgn(I*e)*csgn(I*e*x)^2*Pi-I*csgn(I*x)*c
sgn(I*e*x)^2*Pi+I*csgn(I*e*x)^3*Pi-2*ln(x)-2*ln(e)))+2*I*x*b^2*exp(-1/2*(-1+2*n)*(I*csgn(I*e)*csgn(I*x)*csgn(I
*e*x)*Pi-I*csgn(I*e)*csgn(I*e*x)^2*Pi-I*csgn(I*x)*csgn(I*e*x)^2*Pi+I*csgn(I*e*x)^3*Pi-2*ln(x)-2*ln(e)))/d/n/(x
^n)/(1+exp(2*I*(c+d*x^n)))+b^2/d^2*(e^n)^2/e/n*ln(1+exp(2*I*(c+d*x^n)))*exp(-1/2*I*csgn(I*e*x)*Pi*(-1+2*n)*(-c
sgn(I*e*x)+csgn(I*x))*(-csgn(I*e*x)+csgn(I*e)))-2*b^2/d^2*(e^n)^2/e/n*ln(exp(I*x^n*d))*exp(-1/2*I*csgn(I*e*x)*
Pi*(-1+2*n)*(-csgn(I*e*x)+csgn(I*x))*(-csgn(I*e*x)+csgn(I*e)))+2*I*b/d*(e^n)^2/e*a/n*(-exp(2*I*c))^(1/2)*x^n*l
n(1+exp(I*x^n*d)*(-exp(2*I*c))^(1/2))*exp(-1/2*I*(2*Pi*n*csgn(I*e)*csgn(I*x)*csgn(I*e*x)-2*Pi*n*csgn(I*e)*csgn
(I*e*x)^2-2*Pi*n*csgn(I*x)*csgn(I*e*x)^2+2*Pi*n*csgn(I*e*x)^3-Pi*csgn(I*e)*csgn(I*x)*csgn(I*e*x)+Pi*csgn(I*e)*
csgn(I*e*x)^2+Pi*csgn(I*x)*csgn(I*e*x)^2-Pi*csgn(I*e*x)^3+2*c))-2*I*b/d*(e^n)^2/e*a/n*(-exp(2*I*c))^(1/2)*x^n*
ln(1-exp(I*x^n*d)*(-exp(2*I*c))^(1/2))*exp(-1/2*I*(2*Pi*n*csgn(I*e)*csgn(I*x)*csgn(I*e*x)-2*Pi*n*csgn(I*e)*csg
n(I*e*x)^2-2*Pi*n*csgn(I*x)*csgn(I*e*x)^2+2*Pi*n*csgn(I*e*x)^3-Pi*csgn(I*e)*csgn(I*x)*csgn(I*e*x)+Pi*csgn(I*e)
*csgn(I*e*x)^2+Pi*csgn(I*x)*csgn(I*e*x)^2-Pi*csgn(I*e*x)^3+2*c))+2*b/d^2*(e^n)^2/e*a/n*(-exp(2*I*c))^(1/2)*dil
og(1+exp(I*x^n*d)*(-exp(2*I*c))^(1/2))*exp(-1/2*I*(2*Pi*n*csgn(I*e)*csgn(I*x)*csgn(I*e*x)-2*Pi*n*csgn(I*e)*csg
n(I*e*x)^2-2*Pi*n*csgn(I*x)*csgn(I*e*x)^2+2*Pi*n*csgn(I*e*x)^3-Pi*csgn(I*e)*csgn(I*x)*csgn(I*e*x)+Pi*csgn(I*e)
*csgn(I*e*x)^2+Pi*csgn(I*x)*csgn(I*e*x)^2-Pi*csgn(I*e*x)^3+2*c))-2*b/d^2*(e^n)^2/e*a/n*(-exp(2*I*c))^(1/2)*dil
og(1-exp(I*x^n*d)*(-exp(2*I*c))^(1/2))*exp(-1/2*I*(2*Pi*n*csgn(I*e)*csgn(I*x)*csgn(I*e*x)-2*Pi*n*csgn(I*e)*csg
n(I*e*x)^2-2*Pi*n*csgn(I*x)*csgn(I*e*x)^2+2*Pi*n*csgn(I*e*x)^3-Pi*csgn(I*e)*csgn(I*x)*csgn(I*e*x)+Pi*csgn(I*e)
*csgn(I*e*x)^2+Pi*csgn(I*x)*csgn(I*e*x)^2-Pi*csgn(I*e*x)^3+2*c))

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x)^(-1+2*n)*(a+b*sec(c+d*x^n))^2,x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [B]  time = 2.4007, size = 1631, normalized size = 7.38 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x)^(-1+2*n)*(a+b*sec(c+d*x^n))^2,x, algorithm="fricas")

[Out]

1/2*(a^2*d^2*e^(2*n - 1)*x^(2*n)*cos(d*x^n + c) + 2*b^2*d*e^(2*n - 1)*x^n*sin(d*x^n + c) - 2*I*a*b*e^(2*n - 1)
*cos(d*x^n + c)*dilog(I*cos(d*x^n + c) + sin(d*x^n + c)) - 2*I*a*b*e^(2*n - 1)*cos(d*x^n + c)*dilog(I*cos(d*x^
n + c) - sin(d*x^n + c)) + 2*I*a*b*e^(2*n - 1)*cos(d*x^n + c)*dilog(-I*cos(d*x^n + c) + sin(d*x^n + c)) + 2*I*
a*b*e^(2*n - 1)*cos(d*x^n + c)*dilog(-I*cos(d*x^n + c) - sin(d*x^n + c)) - (2*a*b*c - b^2)*e^(2*n - 1)*cos(d*x
^n + c)*log(cos(d*x^n + c) + I*sin(d*x^n + c) + I) + (2*a*b*c + b^2)*e^(2*n - 1)*cos(d*x^n + c)*log(cos(d*x^n
+ c) - I*sin(d*x^n + c) + I) - (2*a*b*c - b^2)*e^(2*n - 1)*cos(d*x^n + c)*log(-cos(d*x^n + c) + I*sin(d*x^n +
c) + I) + (2*a*b*c + b^2)*e^(2*n - 1)*cos(d*x^n + c)*log(-cos(d*x^n + c) - I*sin(d*x^n + c) + I) + 2*(a*b*d*e^
(2*n - 1)*x^n + a*b*c*e^(2*n - 1))*cos(d*x^n + c)*log(I*cos(d*x^n + c) + sin(d*x^n + c) + 1) - 2*(a*b*d*e^(2*n
 - 1)*x^n + a*b*c*e^(2*n - 1))*cos(d*x^n + c)*log(I*cos(d*x^n + c) - sin(d*x^n + c) + 1) + 2*(a*b*d*e^(2*n - 1
)*x^n + a*b*c*e^(2*n - 1))*cos(d*x^n + c)*log(-I*cos(d*x^n + c) + sin(d*x^n + c) + 1) - 2*(a*b*d*e^(2*n - 1)*x
^n + a*b*c*e^(2*n - 1))*cos(d*x^n + c)*log(-I*cos(d*x^n + c) - sin(d*x^n + c) + 1))/(d^2*n*cos(d*x^n + c))

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x)**(-1+2*n)*(a+b*sec(c+d*x**n))**2,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (b \sec \left (d x^{n} + c\right ) + a\right )}^{2} \left (e x\right )^{2 \, n - 1}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x)^(-1+2*n)*(a+b*sec(c+d*x^n))^2,x, algorithm="giac")

[Out]

integrate((b*sec(d*x^n + c) + a)^2*(e*x)^(2*n - 1), x)